Move endian detection back to runtime to benefit universal binaries on Mac.
authorrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Thu, 15 May 2008 14:19:14 +0000 (14:19 +0000)
committerrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Thu, 15 May 2008 14:19:14 +0000 (14:19 +0000)
gpsbabel/util.c

index 8ded3ea2a3df63a75ffdb185a6e5da93792166b7..41286af81e57923934dc299ea5a797b82e0bb4eb 100644 (file)
 #include <stdarg.h>
 #include <time.h>
 
+// First test Apple's clever macro that's really a runtime test so
+// that our universal binaries work right.
+#if defined __BIG_ENDIAN__
+#define i_am_little_endian !__BIG_ENDIAN__
+#else
 #if defined WORDS_BIGENDIAN
 # define i_am_little_endian 0
 #else
 # define i_am_little_endian 1
 #endif
+#endif
 
 #ifdef DEBUG_MEM
 #define DEBUG_FILENAME "/tmp/gpsbabel.debug"